<!DOCTYPE html>
<html>
    <head>
        <meta name="layout" content="main2" />
        <g:set var="entityName" value="${message(code: 'subscribe.label', default: 'Subscribe')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
      <div class="main-body">
          <div class="page-wrapper">
              <!-- Page-header start -->
              <div class="page-header">
                  <div class="page-header-title">
                      <h4>编辑消息</h4>
                  </div>

                  <div class="page-header-breadcrumb">
                      <ul class="breadcrumb-title">
                          <li class="breadcrumb-item">
                              <a href="/salesDashboard/index">
                                  <i class="icofont icofont-home"></i>
                              </a>
                          </li>
                          <li class="breadcrumb-item">
                              <g:link controller="subscribe" action="index">消息列表</g:link>
                          </li>
                          <li class="breadcrumb-item">编辑消息</li>
                      </ul>
                  </div>
              </div>
              <!-- Page-header end -->
              <!-- Page-body start -->
              <div class="page-body">
                  <g:if test="${flash.message}">
                      <div class="message alert alert-info" role="status">${flash.message}
                          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                              <span aria-hidden="true">×</span></button>
                      </div>
                  </g:if>
                  <g:hasErrors bean="${this.subscribe}">
                      <ul class="errors" role="alert">
                          <g:eachError bean="${this.subscribe}" var="error">
                              <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                                      error="${error}"/></li>
                          </g:eachError>
                      </ul>
                  </g:hasErrors>
              <!-- Hover table card start -->
                  <div class="card">
                      <div class="card-header">
                          <h5>编辑消息</h5>

                          <div class="card-header-right">
                              <i class="icofont icofont-rounded-down"></i>
                          </div>
                      </div>

                      <div class="card-block">
                          <g:form resource="${this.subscribe}" method="PUT" class="form-horizontal">
                              <div class="form-group row">
                                  <label class="col-md-2 col-form-label is-required">主题</label>

                                  <div class="col-md-3"><g:textField class="form-control" name="subject" id="subject"
                                                   value="${this.subscribe?.subject}"/></div>

                                  <label class="col-md-2 col-form-label is-required">链接</label>

                                  <div class="col-md-3">

                                    <g:textField class="form-control" name="link" id="link"
                                                 value="${this.subscribe?.link}"/>
                                  </div>
                              </div>
                              <div class="form-group row">

                                  <label class="col-md-2 col-form-label">标签</label>

                                  <div class="col-md-3">
                                    <g:textField class="form-control" name="tag" id="tag"
                                                 value="${this.subscribe?.tag}"/>

                                  </div>

                                  <label class="col-md-2 col-form-label">来源</label>

                                  <div class="col-md-3">
                                    <g:select class="form-control" name="source" value="${this.subscribe?.source?.id}" id="source"
                                              optionKey="id" optionValue="fullName" from="${com.next.User.list()}"
                                              noSelection="${['': '请选择']}"/>

                                  </div>

                              </div>
                              <div class="form-group row">

                                  <label class="col-md-2 col-form-label is-required">所有者</label>

                                  <div class="col-md-3">
                                    <g:select class="form-control" name="user" value="${this.subscribe?.user?.id}" id="user"
                                              optionKey="id" optionValue="fullName" from="${com.next.User.list()}"
                                              noSelection="${['': '请选择']}"/>

                                  </div>

                              </div>

                              <div class="form-group row">
                                  <div class="col-md-12">
                                      <g:submitButton class="btn btn-info" name="update" value="保存"/></div>
                              </div>
                          </g:form>


                      </div>
                  </div>
                  <!-- Hover table card end -->
              </div>

              <!-- Page-body end -->
          </div>
      </div>
    </body>
</html>
